//
//  LBNestScrollViewController.m
//  TEXT
//
//  Created by liubo on 2023/11/10.
//  Copyright © 2023 刘博. All rights reserved.
//

#import "LBNestScrollViewController.h"
#import "KKScrollView.h"

@interface LBNestScrollViewController ()

@property (nonatomic, strong) UIScrollView *belowScrollView;

@property (nonatomic, strong) UIScrollView *middleScrollView;

@property (nonatomic, strong) UIScrollView *onScrollViewl;

@end

@implementation LBNestScrollViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.belowScrollView];
    [self.belowScrollView addSubview:self.middleScrollView];
    [self.middleScrollView addSubview:self.onScrollViewl];
    // Do any additional setup after loading the view.
}

- (UIScrollView *)belowScrollView
{
    if (!_belowScrollView) {
        _belowScrollView = [[KKScrollView alloc] initWithFrame:CGRectMake(10, 100, 200, 100)];
        _belowScrollView.backgroundColor = [UIColor cyanColor];
        _belowScrollView.contentSize = CGSizeMake(200, 100);
    }
    return _belowScrollView;
}

- (UIScrollView *)middleScrollView
{
    if (!_middleScrollView) {
        _middleScrollView = [[KKScrollView alloc] initWithFrame:CGRectMake(0, 0, 200, 100)];
        _middleScrollView.backgroundColor = [UIColor redColor];
        _middleScrollView.contentSize = CGSizeMake(300, 100);
    }
    return _middleScrollView;
}

- (UIScrollView *)onScrollViewl
{
    if (!_onScrollViewl) {
        _onScrollViewl = [self scroll];
        _onScrollViewl.frame = CGRectMake(0, 0, 200, 100);
        _onScrollViewl.backgroundColor = [UIColor greenColor];
    }
    return _onScrollViewl;
}

#pragma mark - uitl

- (UIScrollView *)scroll
{
    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(10, 100, 200, 100)];
    scrollView.contentSize = CGSizeMake(400, 100);
    return scrollView;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
